{template header}
<div class="mainFrame">
	<div class="order-tab-bar">
    	<div class="item"><a href="/?m=$G[m]&c=$G[c]&a=index">全部记录</a></div>
        <div class="item"><a href="/?m=$G[m]&c=$G[c]&status=1">进行中</a></div>
        <div class="item"><a href="/?m=$G[m]&c=$G[c]&status=2">已完成</a></div>
        <div class="item on"><a href="/?m=$G[m]&c=$G[c]&a=newticket">添加返券</a></div>
    </div>
    
    <div class="blank"></div>
    <div class="tableView">
    	<form method="post" autocomplete="off" id="ticketForm">
        <input type="hidden" name="formsubmit" value="yes">
        <input type="hidden" name="formhash" value="{FORMHASH}">
    	<div class="row">
    		<div class="cell cell-name">返券号码:</div>
        	<div class="cell"><input type="text" class="input-text w200" name="sn" id="sn"></div>
        </div>
        <div class="row">
        	<div class="cell cell-name">密码:</div>
        	<div class="cell"><input type="text" class="input-text w200" name="password" id="password"></div>
        </div>
        <div class="tfooter">
        	<div class="cell cell-name">&nbsp;</div>
        	<div class="cell"><input type="button" value="提交" class="button" id="submitBtn"></div>
        </div>
        </form>
    </div>
</div>
<script type="text/javascript">
$("#submitBtn").click(function(e) {
    var sn = $("#sn").val();
	var password = $("#password").val();
	if(!sn){
		alert('请输入返券卡号');
		return false;
	};
	
	if(!password){
		alert('请输入密码');
		return false;
	}
	$("#ticketForm").ajaxSubmit({
		dataType:'json',
		success:function(json){
			if(json && json.errno==0){
				alert('返券使用成功，你以进入消费分红队列。');
			}else {
				alert(json.error);
			}
		}	
	});
});
</script>
{template footer}